import Vue from 'vue'
import Router from 'vue-router'
// import Login from  '../components/Login'
// import Regist from  '../components/Regist'
import bookinfo from "../components/pages/bookinfo"
// import male from  '../components/male'
import reader from  "../components/readerPages/reader"
import category from "../components/category"
import rank from '../components/bookrank'
import ranklist from '../components/bookranklist'
import categorylist from "../components/categorylist"
import HomePage from "../components/HomePage"
import search from "../components/search"
import ElementUI from 'element-ui' //element-ui的全部组件
import 'element-ui/lib/theme-chalk/index.css'//element-ui的css
Vue.use(ElementUI) //使用elementUI
Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
        {
          path:'/',
          name:'Home',
          component: resolve => require(['@/components/Home'], resolve),
          meta:{
            keepAlive:false
          },
        },
        // { 
        //   path: '/login', 
        //   name:'Login',
        //   component: resolve => require(['@/components/Login'], resolve),
        //  },
        // { 
        //   path: '/regist', 
        //   name:'Regist',
        //   component: resolve => require(['@/components/Regist'], resolve), 
        // },
        { 
          path: '/homePage', 
          name:'HomePage',
          component: resolve => require(['@/components/HomePage'], resolve), 
        },
        {
          path:'/bookinfo/:bookid',
          name:'bookinfo',
          component: resolve => require(['@/components/pages/bookinfo'], resolve),
          meta:{
            keepAlive:false
          }
        },
        {
          path:'/category',
          name:'category',
          component: resolve => require(['@/components/category'], resolve),
          meta:{
            keepAlive:true
          }
        },
        {
          path:'/rank',
          name:'rank',
          component: resolve => require(['@/components/bookrank'], resolve),
          meta:{
            keepAlive:true
          }
        },
        {
          path:'/ranklist/:rankid',
          name:'ranklist',
          component: resolve => require(['@/components/bookranklist'], resolve),
          meta:{
            keepAlive:true
          }
        },
        {
          path:'/categorylist',
          name:'categorylist',
          component: resolve => require(['@/components/categorylist'], resolve),
          meta:{
            keepAlive:true
          }
        },
        {
          path:'/search',
          name:'search',
          component: resolve => require(['@/components/search'], resolve),
          meta:{
            keepAlive:false
          }
        },
        {
          path:'/reader/:bookid',
          name:'reader',
          component: resolve => require(['@/components/readerPages/reader'], resolve),
          meta:{
            keepAlive:false,
            isShowFoot:false
          }
        }
  ]
})
